// 2025/3/24
// 在字符串中找出连续最长数字串

#include <iostream>
using namespace std;

int main() {
    string str; cin >> str;
    int n = str.size();
    int Mleft = 0, Mright = 0;
    int left = 0, right = 0;

    while(right < n)
    {
        if('0' <= str[left] && str[left] <= '9')
        {
            while(right < n && '0' <= str[right] && str[right] <= '9')
                right++;
            if(right - left > Mright - Mleft)
            {
                Mright = right;
                Mleft = left;
            }
            left = right;
        }
        else 
        {
            left++;
            right++;
        }
    }

    string ans(str.begin() + Mleft, str.begin() + Mright);
    cout << ans << endl;
}
// 64 位输出请用 printf("%lld")